load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test")

package(default_visibility = [
    "//rs/crypto:__subpackages__",
])

DEPENDENCIES = [
    # Keep sorted.
    "//rs/certification",
    "//rs/crypto/internal/crypto_lib/basic_sig/der_utils",
    "//rs/crypto/internal/crypto_lib/types",
    "//rs/crypto/sha2",
    "//rs/crypto/tree_hash",
    "//rs/types/types",
    "@crate_index//:base64",
    "@crate_index//:hex",
    "@crate_index//:serde",
    "@crate_index//:serde_bytes",
    "@crate_index//:serde_cbor",
    "@crate_index//:simple_asn1",
]

MACRO_DEPENDENCIES = []

DEV_DEPENDENCIES = [
    # Keep sorted.
    "//rs/certification/test-utils",
    "//rs/crypto/internal/crypto_lib/basic_sig/iccsa/test_utils",
    "//rs/crypto/test_utils",
    "//rs/crypto/test_utils/reproducible_rng",
    "//rs/interfaces",
    "@crate_index//:assert_matches",
    "@crate_index//:rand",
]

MACRO_DEV_DEPENDENCIES = []

ALIASES = {}

rust_library(
    name = "iccsa",
    srcs = glob(["src/**"]),
    aliases = ALIASES,
    crate_name = "ic_crypto_internal_basic_sig_iccsa",
    proc_macro_deps = MACRO_DEPENDENCIES,
    version = "0.9.0",
    deps = DEPENDENCIES,
)

rust_test(
    name = "iccsa_integration_test",
    srcs = ["tests/api.rs"],
    proc_macro_deps = MACRO_DEPENDENCIES + MACRO_DEV_DEPENDENCIES,
    deps = DEPENDENCIES + DEV_DEPENDENCIES + [":iccsa"],
)
